<!doctype html>
<html>
<head>
    <title>{$backend_name}-{$code_name}</title>
    <meta name="description" content="">
    {include file="public/head"}
</head>
<body>
<!--header-->
{include file="public/header"}
<div class="tpl-page-container tpl-page-header-fixed">
    <!--menu-->
    {include file="public/menu"}
    <!--html body-->
    <div class="tpl-content-wrapper">
        <!--nav-->
        <div class="tpl-content-page-title">
            {$code_name}
        </div>
        <ol class="am-breadcrumb">
            <li><a href="{:url('index/index')}" class="am-icon-home">首页</a></li>
            <li class="am-active">{$code_name}</li>
        </ol>
        <!--content-->
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> {$code_name}列表
                </div>
                <!--<div class="tpl-portlet-input tpl-fz-ml">
                    <div class="portlet-input input-small input-inline">
                        <div class="input-icon right">
                            <i class="am-icon-search"></i>
                            <input type="text" class="form-control form-control-solid" placeholder="搜索..."></div>
                    </div>
                </div>-->
            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-md-6">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <a href="{:url($code.'/get_new')}" class="am-btn am-btn-default am-btn-success"><span
                                        class="am-icon-plus"></span> 新增
                                </a>
                                <!--<button type="button" class="am-btn am-btn-default am-btn-secondary"><span
                                        class="am-icon-save"></span> 保存
                                </button>
                                <button type="button" class="am-btn am-btn-default am-btn-danger"><span
                                        class="am-icon-trash-o"></span> 删除
                                </button>
                                <button type="button" class="am-btn am-btn-default am-btn-warning to_excel"><span
                                        class="am-icon-archive"></span> 导出Excel
                                </button>-->
                            </div>
                        </div>
                    </div>
                    <!--<div class="am-u-sm-12 am-u-md-3">
                        <div class="am-form-group">
                            <select data-am-selected="{btnSize: 'sm'}" name="status">
                                <option value="all">所有状态</option>
                            </select>
                        </div>
                    </div>-->
                    <div class="am-u-sm-12 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                            <input type="text" class="am-form-field" name="keywords" value="{$keywords}">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
                            </span>
                        </div>
                    </div>
                </div>
                <div class="am-g" style="margin-top:20px;">
                    <div class="tpl-table-images">
                        {foreach $list as $vo}
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
                            <div class="tpl-table-images-content">
                                <div class="tpl-table-images-content-i-time">开始时间：{$vo.begin_at|date='Y-m-d H:i:s',###}</div>
                                <div class="tpl-table-images-content-i-time">结束时间：{$vo.end_at|date='Y-m-d H:i:s',###}</div>
                                <div class="tpl-i-title">
                                    {$vo.name}
                                </div>
                                <a href="{:url($code.'/get_edit',['id'=>$vo.id])}" class="tpl-table-images-content-i" style="height: 200px;overflow: hidden;">
                                    <img src="{$vo.cover?:'__PUBLIC__/admin/img/other.svg'}" alt="{$vo.name}" />
                                </a>
                                <div class="tpl-table-images-content-block">
                                    <div class="tpl-i-font">
                                        <div>修改时间：{$vo.update_time|date='Y-m-d H:i:s',###}</div>
                                        <div>
                                            {if condition="$vo.status == 1"}
                                            <span class="am-badge am-badge-success am-radius">活动开启</span>
                                            {else/}
                                            <span class="am-badge am-badge-danger am-radius">活动关闭</span>
                                            {/if}
                                            {if condition="$vo.is_pass == 1"}
                                            <span class="am-badge am-badge-success am-radius">需要审核</span>
                                            {else/}
                                            <span class="am-badge am-badge-danger am-radius">不需要审核</span>
                                            {/if}
                                        </div>
                                    </div>
                                    <div class="tpl-i-more">
                                        <ul>
                                            <a href="{:url('participant/index',['active_id'=>$vo.id,'search_status'=>0])}">
                                                <li style="width:100%;">{:wait_number($vo.id)}</li>
                                            </a>
                                        </ul>
                                    </div>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs tpl-edit-content-btn">
                                            <!--<button type="button" class="am-btn am-btn-default am-btn-success"><span
                                                    class="am-icon-plus"></span> 新增
                                            </button>-->
                                            <a href="{:url($code.'/get_edit',['id'=>$vo.id])}" class="am-btn am-btn-default">
                                                <span class="am-icon-edit"></span> 编辑
                                            </a>
                                            <a type="button" class="am-btn am-btn-default am-btn-warning share_btn" data-id="{$vo.id}">
                                                <span class="am-icon-archive"></span> 渠道
                                            </a>
                                            <a href="{:url('participant/index',['active_id'=>$vo.id])}" class="am-btn am-btn-default am-btn-secondary">
                                                <span class="am-icon-archive"></span> 人员
                                            </a>
                                            <a href="{:url('report/index',['active_id'=>$vo.id])}" class="am-btn am-btn-default am-btn-success">
                                                <span class="am-icon-archive"></span> 报表
                                            </a>
                                            {if condition="$vo.is_draw == 1"}
                                            <a href="{:url('reward/index',['active_id'=>$vo.id])}" class="am-btn am-btn-default am-btn-danger ">
                                                <span class="am-icon-archive"></span> 奖励
                                            </a>
                                            {/if}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/foreach}
                        <div class="am-u-lg-12">
                            <div class="am-cf">
                                <div class="am-fr">
                                    {$page}
                                </div>
                            </div>
                            <hr>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>
    </div>
</div>
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
    <div class="am-modal-dialog" style="width:40%;">
        <div class="am-modal-hd">渠道地址</div>
        <div class="am-modal-bd">

        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn">确定</span>
        </div>
    </div>
</div>
<!--js-->
{include file="public/js"}
<script type="text/javascript">
    $('.am-icon-search').click(function(){
        var keywords = $('input[name=keywords]').val();
        window.location.href = '{:url($code."/index")}?keywords='+keywords;
    });

    $('.address-btn').click(function(){
        $('.am-modal-bd').text($(this).attr('data-url'));
        $('#my-alert').modal('open');
    });
    $('.share_btn').click(function(){
        var id = $(this).attr('data-id');
        var modal_body = $('.am-modal-bd');
        modal_body.text('请稍候');
        $.get('{:url("share_link")}?path=__PUBLIC__&id='+id,function(data){
            if(data.code==0){
                modal_body.html(data.html);
                $('#my-alert').modal('open');
            }
        },'json');
    });
</script>
</body>
</html>